import java.util.Scanner;

public class Text10 {
    public static void main(String[] args) {
//        10.例：用户输入2045，输出结果为：个位：5，十位：4，百位：0，千位：2，和为：11
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个四位数");
        int number = sc.nextInt();
        int a = number %10;
        int b = number/10%10;
        int c = number/100%10;
        int d = number/1000%10;
        System.out.println("个位数是:"+a);
        System.out.println("十位数是:"+b);
        System.out.println("百位数是:"+c);
        System.out.println("千位数是:"+d);
        System.out.println("个，十，百，千位的数字的和是："+(a+b+c+d));
    }
}
